
IF EXISTS(SELECT 1 FROM sys.objects where object_id = OBJECT_ID(N'[dbo].[getCartProductsById]') and type in (N'P',N'PC'))
DROP PROCEDURE getCartProductsById
GO

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		Francis Adediran
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE getCartProductsById
	@cartId int
AS
BEGIN
	SET NOCOUNT ON;

    -- Insert statements for procedure here
	SELECT sc.productId,sc.quantity,p.modelName as name,p.productImage,p.unitCost FROM shoppingCart sc
	inner join Product p on
	p.productId=sc.productId
	 where sc.cartId=@cartId
END
GO

